﻿<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ProductListControl.ascx.vb" Inherits="LinhKienMayTinh.ProductListControl" %>
<%@ Import Namespace="LinhKienMayTinh.CommonMethods" %>
<div class="product-list">
<%
    If IsNothing(dsSource) = False AndAlso dsSource.Tables(0).Rows.Count > 0 Then
        Dim i As Integer = 0
        For Each row As Data.DataRow In dsSource.Tables(0).Rows
            i = i + 1
%>
    <a href="<%= ResolveUrl("~/" & row("CATEGORY_LINK_NAME") & "/" & row("MANUFACTORY_LINK_NAME") & "/" & row("PRODUCT_LINK_NAME")) & "/" %>" title="<%= Nz(row("PRODUCT_NAME"), "")%>">
    <div class="product-item">        
        <div class="product-item-image">            
            <img src="<%= ResolveUrl(Nz(row("IMG_LINK"), "")) %>" alt="<%= Nz(row("PRODUCT_NAME"), "")%>" title="<%= Nz(row("PRODUCT_NAME"), "")%>" />            
        </div>
        <div class="product-item-name">            
            <span><%= Nz(row("PRODUCT_NAME"), "")%></span>            
        </div>
        <div class="product-item-price">
            <%
                Dim xPrice As String = Replace(Format(Nz(row("PRICE"), ""), "#,##0"), ",", ".")
                If xPrice = "0" Then
                    xPrice = "CALL"
                Else
                    xPrice = xPrice & " VNĐ"
                End If
            %>            
            <span><%= xPrice%></span>
        </div>
    </div>
    </a>    
<%        
Next
Else
%>
<div style="text-align: center">
    <h3>Không có sản phẩm nào.</h3>
</div>
<%End If%>
</div>